<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>生活家电_严选好物_趣玩</title>
    <link rel="stylesheet" href="css/resest.css">
    <link rel="stylesheet" href="font/iconfont.css">
    <link rel="icon" type="images/x-ico" href="images/favicon.ico">
    <link rel="stylesheet" href="css/list.css">
</head>

<body>
    <header></header>
    <section>
        <div class="goods">
            <div class="goods-center">
                <div class="goods-top">
                    <a href="">首页</a>
                    <span class="iconfont icon-xiangyoujiantou"></span>
                    <a href="">严选好物</a>
                    <span class="iconfont icon-xiangyoujiantou"></span>
                    <a href="">生活家电</a>
                </div>
                <div class="goods-end">
                    <ul class="goods-header">
                        <li class="classify">
                            <span>分类:</span>
                            <ul>
                                <li>生活家电</li>
                                <li>日用家居</li>
                                <li>个人配饰</li>
                                <li>特色食品</li>
                            </ul>
                        </li>
                        <li class="classify">
                            <span>品牌：</span>
                            <ul>
                                <li>诗杭</li>
                                <li>大宇</li>
                                <li>德尔玛</li>
                                <li>HOMEE</li>
                                <li>摩飞</li>
                                <li>集米</li>
                                <li>都乐</li>
                                <li>阿乐乐可</li>
                                <li>东菱</li>
                                <li>鸣盏</li>
                                <li>志高</li>
                                <li>麦子厨房</li>
                                <li>摩也</li>
                                <li>lena</li>
                                <li>小七泡泡</li>
                                <li>唱吧</li>
                                <li>小豹</li>
                                <li>诗航</li>
                                <li>nathome北欧欧慕</li>
                                <li>生活元素</li>
                                <li>根元</li>
                                <li>VH</li>
                                <li>素士</li>
                                <li>品夏</li>
                                <li>日本tomoni</li>
                                <li>PGG</li>
                            </ul>
                        </li>
                        <li class="sort">
                            <ul>
                                <li><a href="">销量</a> <span class="iconfont icon-paixu"></span></li>
                                <li><a href="">价格</a> <span class="iconfont icon-paixu"></span></li>
                                <li><a href="">上架时间</a> <span class="iconfont icon-paixu"></span></li>
                            </ul>
                        </li>
                    </ul>
                    <ul class="particulars">
                        <!-- <li class="g-item">
                            <div class="g-img"><img src="images/g-01.jpg" alt=""></div>
                            <a href="">麦子厨房多功能三明治早餐机SW-005</a>
                            <p>￥ 208.00</p>
                            <hr>
                        </li>
                        <li class="g-item">
                            <div class="g-img"><img src="images/g-02.jpg" alt=""></div>
                            <a href="">麦子厨房小红锅多功能华夫饼机5</a>
                            <p>￥ 668.00</p>
                            <hr>
                        </li>
                        <li class="g-item">
                            <div class="g-img"><img src="images/g-03.jpg" alt=""></div>
                            <a href="">素士声波电动牙刷X3U梵高版-绿野玫瑰</a>
                            <p>￥ 369.00</p>
                            <hr>
                        </li>
                        <li class="g-item">
                            <div class="g-img"><img src="images/g-04.jpg" alt=""></div>
                            <a href="">素士H5负离子电吹风-绿野玫瑰</a>
                            <p>￥ 329.00</p>
                            <hr>
                        </li>
                        <li class="g-item">
                            <div class="g-img"><img src="images/g-05.jpg" alt=""></div>
                            <a href="">素士H5负离子电吹风女神红</a>
                            <p>￥ 299.00</p>
                            <hr>
                        </li>
                        <li class="g-item">
                            <div class="g-img"><img src="images/g-01.jpg" alt=""></div>
                            <a href="">品夏空气炸锅5.2升LQ-3501</a>
                            <p>￥ 299.00</p>
                            <hr>
                        </li> -->
                    </ul>
                </div>
            </div>
        </div>
    </section>
    <footer></footer>
</body>

</html>
<script src="js/jquery.js"></script>
<script>
    $("header").load("header.html");
    $("footer").load("footer.html");

    $(function () {
        getData();
    })
    function getData() {
        $.get(
            'goodsAndShoppingCart/getGoodsList.php',
            { "typeId": "001" },
            function (data) {
                console.log(JSON.parse(data))
                let arr = JSON.parse(data);
                let str = "";
                arr.forEach((item, index) => {
                    str += ` <li class="g-item">
                            <div class="g-img"><img src=${item.goodsImg} alt=""></div>
                            <a href="">${item.goodsName}</a>
                            <p>￥ ${item.goodsPrice}.00</p>
                            <hr>
                        </li>`
                });
                $(".particulars").html(str);
                $(".particulars .g-item  a").each(function (index, item) {
                    $(item).parent().attr("title", `${$(item).text()}`)
                })
            }
        )
    }

</script>